export default {
    data() {
        return {
            //设置默认的分享参数
            share: {
                title: '玖合素手',
                path: '/pages/index/index',
                imageUrl: '',
            }
        }
    },
    onLoad() {
        //分享页面路径黑名单
        const urlList = [
            'pages/ticket/coupon-list'
        ]
        //获取路由信息
        const pages = getCurrentPages()
        //获取当前路由
        let nowPage = pages[pages.length - 1]
        //判断路由包含‘takeoutPackageA’标识的同时不包含有白名单的路由就禁用
        if (urlList.includes(nowPage.route)) {
            uni.hideShareMenu()
        }
    },
    onShareAppMessage(res) {
        const pages = getCurrentPages()
        //获取当前路由
        let nowPage = pages[pages.length - 1]
        if (nowPage.route == 'pages/ticket/coupon-list') return
        return {
            title: this.share.title,
            path: this.share.path,
            imageUrl: this.share.imageUrl
        }
    },
    onShareTimeline(res) {
        return {
            title: this.sharedata.title,
            query: '',
            imageUrl: this.sharedata.imageurl,
        }
    },
}
